package com.csun.cmny.provider.model.dto.watch;

import com.csun.cmny.provider.validator.DmcWatchAlarmClockAddValidator;
import com.csun.cmny.provider.validator.DmcWatchAlarmClockEditValidator;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.persistence.Column;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-01-25 15:26
 * @Description: the class watch alarm clock dto
 */
@Data
@ApiModel(value = "添加孝心手环智能提醒Dto")
public class WatchAlarmClockDto implements Serializable {

    private static final long serialVersionUID = -4777235778383653278L;

    /**
     * 提醒Id
     */
    @NotNull(message = "{watch.alarm.clock.id.null}",
            groups = DmcWatchAlarmClockEditValidator.class)
    private Long id;

    /**
     * 设备Id
     */
    @NotNull(message = "{device.id.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    private Long deviceId;

    /**
     * 闹钟类型 0-吃药提醒 1-喝水提醒 2-运动提醒 3-自定义1 4-自定义2 5-自定义3
     */
    @NotNull(message = "{watch.alarm.clock.type.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 5, message = "{watch.alarm.clock.type.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private Integer clockType;

    /**
     * 闹钟开关 0-关 1-开
     */
    @NotNull(message = "{watch.alarm.clock.switch.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 1, message = "{watch.alarm.clock.switch.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private Integer clockSwitch;

    /**
     * 闹钟时间 范围0000-2359
     */
    @NotNull(message = "{watch.alarm.clock.time.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Pattern(regexp = "^([0-1]+[0-9]|2[0-3])([0-5][0-9])$",
            message = "{watch.config.clock.time.pattern}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private String clockTime;

    /**
     * 周一是否重复 0-不重复 1-重复
     */
    @NotNull(message = "{watch.alarm.clock.repeat.mon.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 1, message = "{watch.alarm.clock.repeat.mon.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private Integer repeatMon;

    /**
     * 周二是否重复 0-不重复 1-重复
     */
    @NotNull(message = "{watch.alarm.clock.repeat.tue.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 1, message = "{watch.alarm.clock.repeat.tue.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private Integer repeatTue;

    /**
     * 周三是否重复 0-不重复 1-重复
     */
    @NotNull(message = "{watch.alarm.clock.repeat.wed.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 1, message = "{watch.alarm.clock.repeat.wed.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private Integer repeatWed;

    /**
     * 周四是否重复 0-不重复 1-重复
     */
    @NotNull(message = "{watch.alarm.clock.repeat.thu.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 1, message = "{watch.alarm.clock.repeat.thu.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private Integer repeatThu;

    /**
     * 周五是否重复 0-不重复 1-重复
     */
    @NotNull(message = "{watch.alarm.clock.repeat.fri.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 1, message = "{watch.alarm.clock.repeat.fri.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
        private Integer repeatFri;

    /**
     * 周六是否重复 0-不重复 1-重复
     */
    @NotNull(message = "{watch.alarm.clock.repeat.sat.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 1, message = "{watch.alarm.clock.repeat.sat.range}")
    private Integer repeatSat;

    /**
     * 周日是否重复 0-不重复 1-重复
     */
    @NotNull(message = "{watch.alarm.clock.repeat.sun.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 1, message = "{watch.alarm.clock.repeat.sun.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private Integer repeatSun;

    /**
     * 铃声类型 0 amr
     */
    @NotNull(message = "{watch.alarm.clock.voice.type.null}",
            groups = DmcWatchAlarmClockAddValidator.class)
    @Range(min = 0, max = 0, message = "{watch.alarm.clock.voice.type.range}",
            groups = {DmcWatchAlarmClockAddValidator.class, DmcWatchAlarmClockEditValidator.class})
    private Integer voiceType;

    /**
     * 铃声文件
     */
    private byte[] voiceData;

    /**
     * 是否需要下发 0-不需要 1-需要
     */
    private Integer isNeed;

}
